
import pytest
from likeshop_project.base.mybase import Tools
from likeshop_project.accountapi.login_api import login_model

class obtain_address_detail_model(Tools):
    path = '/api/user_address/detail'


    def obtain_address_detail_action(self,id,hb):
        mydata = {
            'id':id
        }
        # self.r = self.mydb("select sheng.id,shi.id,xian.id  from dsdev_region as sheng  join dsdev_region as shi on sheng.id = shi.parent_id  join dsdev_region as xian on shi.id = xian.parent_id; ")
        res = self.huihua.get(url=self.hosturl+self.path,params=mydata,headers=hb)

        return res.json()
if __name__ == '__main__':

    import requests
    s = requests.session()
    re = login_model(huihua=s)
    mfg = re.login_action(account='17909898989',password='123wqewqrf')
    gettoken = mfg['data'].get('token')
    hb = {'token':gettoken}
    reg = obtain_address_detail_model(huihua=s)
    mas = reg.obtain_address_detail_action(id='852',hb=hb)
    print(mas)




